package com.text.service.impl;

import com.text.dao.AdminuserDao;
import com.text.entity.Adminuser;
import com.text.service.AdminuserService;
import jakarta.annotation.Resource;
import org.springframework.stereotype.Service;
import org.springframework.util.DigestUtils;

import java.nio.charset.StandardCharsets;

@Service
public class AdminuserServiceImpl implements AdminuserService {
    @Resource
    AdminuserDao adminuserDao;

    @Override
    public Adminuser getAdminuser(Adminuser adminuser) {
        System.out.println(adminuser.getPassword());
        String psw = DigestUtils.md5DigestAsHex(adminuser.getPassword().getBytes());
        adminuser.setPassword(psw);
        System.out.println("psw:"+psw);
        return adminuserDao.getAdminuser(adminuser);
    }
}
